package com.nbsaas.boot.project.rest.convert;

import com.nbsaas.boot.project.data.entity.DataModel;
import com.nbsaas.boot.project.api.domain.simple.DataModelSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class DataModelSimpleConvert implements Converter<DataModelSimple, DataModel> {




@Override
public DataModelSimple convert(DataModel source) {
    DataModelSimple result = new DataModelSimple();

                result.setNote(source.getNote());
                result.setName(source.getName());
                if(source.getProject()!=null){
                    result.setProject(source.getProject().getId());
                }
                result.setId(source.getId());
                if(source.getProject()!=null){
                    result.setProjectName(source.getProject().getName());
                }


    return result;
}

}